﻿using System;
using SSTU.ViewModel.Core;

namespace SSTU.ViewModel.Item
{
	/// <summary>
	/// View model for faculty.
	/// </summary>
	public class FacultyItemVM : ViewModelBase
	{
		private string _id;
		private string _shortName;
		private string _longName;

		/// <summary>
		/// Initializes a new instance of the <see cref="FacultyItemVM"/> class.
		/// </summary>
		public FacultyItemVM()
			: this(null, null, null)
		{
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="FacultyItemVM"/> class.
		/// </summary>
		public FacultyItemVM(string id, string shortName, string longName)
		{
			Id = id;
			ShortName = shortName;
			LongName = longName;
		}

		/// <summary>
		/// Gets or sets identifier.
		/// </summary>
		public string Id
		{
			get { return _id; }
			set
			{
				if (value != _id)
				{
					RaisePropertyChanging<string>(() => Id);
					_id = value;
					RaisePropertyChanged<string>(() => Id);
				}
			}
		}

		/// <summary>
		/// Gets or sets short name (abbreviation).
		/// </summary>
		public string ShortName
		{
			get { return _shortName; }
			set
			{
				if (value != _shortName)
				{
					RaisePropertyChanging<string>(() => ShortName);
					_shortName = value;
					RaisePropertyChanged<string>(() => ShortName);
				}
			}
		}

		/// <summary>
		/// Gets or sets long (full) name.
		/// </summary>
		public string LongName
		{
			get { return _longName; }
			set
			{
				if (value != _longName)
				{
					RaisePropertyChanging<string>(() => LongName);
					_longName = value;
					RaisePropertyChanged<string>(() => LongName);
				}
			}
		}
	}
}
